<?php


namespace Trawind\Remotes\Repositories\Account\Log;

use Trawind\Basics\Enums\ServiceDomain;
use Trawind\Remotes\BaseRepository;
use Trawind\Remotes\Contracts\Repositories\Account\Log\LogOperationRepository;

/**
 * Class LogOperationRepositoryEloquent
 * @package Trawind\Log\Remotes
 */
class LogOperationRepositoryEloquent extends BaseRepository implements LogOperationRepository
{

    public $baseRoute='/account/log-operations';
    

    public function __construct()
    {
        $this->domain = ServiceDomain::ACCOUNT_DOMAIN();
    }

    /**
     * @param array $attributes
     * @example [
        "business_type_id"=>BusinessType::STAFF,
        "business_id"=>343,
        "service"=>config('app.name'),
        "action"=>'create',
        "result"=>'Created successfully',
        'ip'=>request()->getClientIp()
     ]
     * @return mixed|null
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function create(array $attributes)
    {
        return $this->setUrl($this->baseRoute)
            ->setClientOptions(['form_params' => $attributes],false)
            ->result('POST');
    }

    public function all($columns = ['*'])
    {
        // TODO: Implement all() method.
    }

    public function find($id, $columns = ['*'])
    {
        // TODO: Implement find() method.
    }

    public function update(array $attributes, $id)
    {
        // TODO: Implement update() method.
    }
}
